import request from '@/utils/request'


// 查询按类型分组的商品库存列表（新接口）
export function listMedicineStocksByType() {
  return request({
    url: '/medicine/medicineStocks/listByType',
    method: 'get'
  })
}


// 获取所有药品列表
export function listAllMedicines(query) {
  return request({
    url: '/medicine/medicineStocks/list',
    method: 'get',
    params: query
  })
}

//提交就诊记录
export function submitTreatmentRecord(submitData) {
  return request({
    url: '/treatment/treatmentMessage/submitRecord',
    method: 'post',
    data: submitData
  })

}

export function getPrescriptionMedicines(prescriptionId) {
  return request({
    url: '/treatment/treatmentMessage/getYaodan',
    method: 'post',
    data: { prescriptionId: prescriptionId }  // 传递对象而不是字符串
  })

}






















// 查询就诊信息列表
export function listTreatmentMessage(query) {
  return request({
    url: '/treatment/treatmentMessage/list',
    method: 'get',
    params: query
  })
}

// 查询就诊信息详细
export function getTreatmentMessage(treatId) {
  return request({
    url: '/treatment/treatmentMessage/' + treatId,
    method: 'get'
  })
}

// 新增就诊信息
export function addTreatmentMessage(data) {
  return request({
    url: '/treatment/treatmentMessage',
    method: 'post',
    data: data
  })
}

// 修改就诊信息
export function updateTreatmentMessage(data) {
  return request({
    url: '/treatment/treatmentMessage',
    method: 'put',
    data: data
  })
}

// 删除就诊信息
export function delTreatmentMessage(treatId) {
  return request({
    url: '/treatment/treatmentMessage/' + treatId,
    method: 'delete'
  })
}
